<!DOCTYPE html>
<html lang="en">
<head>
    {% load staticfiles %}
    <meta charset="UTF-8">
    <title>用户修改</title>
{#    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.css">#}
    <script src="/static/bootstrap/js/jquery-2.1.4.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.js"></script>
</head>
<body>
{#    <h1>稍等片刻</h1>#}
{#    {% include 'stu_exam_manage/info_upd/line_back/info_upd_back.html' %}     <!-- 线背景 -->#}
{#    {% include 'stu_exam_manage/info_upd/suidao_back/suidao_back.html' %}     <!-- 隧道背景 -->#}

    <h1>信息修改</h1>
    <form action="" method="post" onsubmit="return false;">
        课程选择：{{ courseform.name }} {{ courseform.errors.0 }} &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="submit" value="修改" onclick="submit_course()">
    </form>
</body>
<script>
    function init() {
        // 设置课程选择的默认选择
        $("#course option[value='{{ courseid }}']").prop("selected",true);

    }
    init();     // 初始化

    // 课程修改提交
    function submit_course() {
        res = confirm('确定提交？')
        if(res){
            // 异步提交课程修改信息
            $.ajax({
                    url: '',
                    type: 'post',
                    data: {'name':$('#course').val()},
                    dataType: 'json',
                    success: function (arg) {
                        console.log(arg);
                        if(arg.code == 200){
                            alert('修改成功')
                        }else{
                            alert(arg.msg)
                        }
                    }
                })
        }
    }
</script>
</html>